home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 212
/
212.d81
/
sliding blocks
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
189 lines
5 poke56576,6:poke53272,222:poke648,116:poke53265,27:poke56,116:poke55,0
6 s9=54272:fori=s9tos9+24:pokei,0:next
7 bb$="[155] sliding blocks[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
8 sz$="[145] [145]"
10 poke53280,0:poke53281,0:print"[147]":printbb$
30 poke53269,0:poke30712,248:poke53287,1
40 dimpc(6,7,5),dn(5,6,5)
50 forx=1to4:readbk$(x):next
60 data"[207][183][183][208][157][157][157][157][180][160][160][170][157][157][157][157][204][175][175][186]","[207][183][183][183][183][183][183][208][157][157][157][157][157][157][157][157][180][160][160][160][160][160][160][170][157][157][157][157][157][157][157][157][204][175][175][175][175][175][175][186]"
70 data"[207][183][183][208][157][157][157][157][180][160][160][170][157][157][157][157][180][160][160][170][157][157][157][157][180][160][160][170][157][157][157][157][180][160][160][170][157][157][157][157][204][175][175][186]"
80 data"[207][183][183][183][183][183][183][208][157][157][157][157][157][157][157][157][180][160][160][160][160][160][160][170][157][157][157][157][157][157][157][157][180][160][160][160][160][160][160][170][157][157][157][157][157][157][157][157][180][160][160][160][160][160][160][170][157][157][157][157][157][157][157][157]"
90 bk$(4)=bk$(4)+"[180][160][160][160][160][160][160][170][157][157][157][157][157][157][157][157][204][175][175][175][175][175][175][186]"
100 forgm=1to5:fory=2to6:forx=2to5:readpc(x,y,gm):next:next:next
110 data4,-1,2,-1, -4,-5,2,-1, 1,,,1, 3,3,2,-1, -4,-4,2,-1
120 data0,4,-1,, 3,-4,-5,3, -4,1,1,-4, 3,1,1,3, -4,2,-1,-4
130 data3,,,3, -4,4,-1,-4, 3,-4,-5,3, -4,2,-1,-4, 1,1,1,1
140 data1,4,-1,1, 3,-4,-5,3, -4,3,,-4, 1,-4,,1, 2,-1,2,-1
150 data1,4,-1,1, 3,-4,-5,3, -4,3,,-4, 1,-4,,1, 2,-1,2,-1
160 forgm=1to5:fory=2to6:forx=2to5:readdn(x,y,gm):next:next:next
170 data0,,,,,,,,,,,,,,4,,,,,0
180 data3,3,3,3,,,,,,2,,,1,4,,1,1,,,1
190 data0,,,,,,,,,,,,,4,,,,,,0
200 data0,,,,,,,,,,,,,4,,,,,,0
210 data2,,2,,1,,3,1,3,,,3,,4,,,1,,,1
220 forx=1to5:readdn$(x):next
230 data"[172][163][157][157][165] "
240 data"[172][172][172][172][157][157][157][157][165][165][165][165][157][157][157][146][172][163][157][157][157][146][172][172][163][146][172][157][157][157][157][172][165] [146][172]"
250 data"[172][163][157][157][165] "
260 data"[172][163][157][157][165] "
270 data"[172][163][146][172][163][146][157][157][157][157][172] [172][172][157][157][157][157][172] [165][146][172][157][157][157][157][165][146][172][163][165][146][157][157][157][157][172][165] [146][172]"
280 forx=1to5:readmv(x),bg(x):next
290 data 39,49152, 107,49232, 162,49448, 147,49774, 258,50070
300 forx=1to5:readgm$(x):next
310 datadad's puzzler,pioneer 1,the donkey,the century,century and a half
320 printbb$:print"[155]":forx=1to5:printtab(9)""x"[154] "gm$(x):print:next
325 poke53269,0
330 printtab(10)"[155](i[155])nstructions"
340 printtab(10)"(s[155])olutions"
345 printtab(10)"(q[155])uit to loadstar"
350 print" [159](c) 1990 by brian boese":poke198,0
360 geta$:ifa$<>"q"anda$<>"i"anda$<>"s"and(a$<"1"ora$>"5")then360
370 ifa$="i"thengosub1140:print"[147]":goto320
380 ifa$<>"q"then430
390 poke214,19:print:print" [156]quit - are you sure? (y[156]/n[156])":poke198,0
400 geta$:ifa$<>"y"anda$<>"n"then400
410 ifa$="n"thenprintsz$:goto320
420 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15:printer
422 ifer<>63thenpoke56576,151:poke648,4:poke53272,21:poke53269,0:print"[147]":end
424 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
426 print"run"
428 poke631,13:poke632,13:poke198,2:end
430 ifa$<>"s"then640
440 poke214,17:print:print" [156]solution for which? (1[156]-5[156])":poke198,0
450 geta$:ifa$<>"q"and(a$<"1"ora$>"5")then450
460 ifa$="q"thenprintsz$:goto320
470 gosub1450:ps=bg(gm)
480 geta$:ifa$<>"q"then530
490 poke214,21:print:print" [156]quit - are you sure? (y[156]/n[156])"
500 geta$:ifa$<>"y"anda$<>"n"then500
510 ifa$="y"thenrun
530 fm=peek(ps):dr=peek(ps+1):ps=ps+2:iffm+dr=0then610
540 y=int(fm/4+2):x=fm-(y-2)*4+2:pc=pc(x,y,gm)
550 gosub1350
560 ifdr=0theny=y-1
570 ifdr=1thenx=x+1
580 ifdr=2theny=y+1
590 ifdr=3thenx=x-1
600 gosub1400:forq=1to200:next:goto480
610 poke214,21:print:print" [158]press any key to continue"
620 gosub1280
630 run
640 gosub1450
650 poke53248,11+32*x:poke53249,49+24*y:poke53269,1
655 poke214,21:print:print" [156]press q[156] to quit to menu"
660 gosub1280
670 ifa$<>"q"then720
680 poke214,21:print:print" [156]quit - are you sure? (y[156]/n[156])":poke198,0
690 geta$:ifa$<>"y"anda$<>"n"then690
700 ifa$="y"thenrun
710 printsz$:goto655
720 ifa$=""theny=y-(y<6)
730 ifa$="[145]"theny=y+(y>2)
740 ifa$="[157]"thenx=x+(x>2)
750 ifa$=""thenx=x-(x<5)
760 ifa$<>chr$(13)orpc(x,y,gm)=0then650
770 gosub50770:dx=0:dy=0:ifpc(x,y,gm)>0then800
780 ifpc(x,y,gm)<>-4thenx=x-1:dx=1
790 ifpc(x,y,gm)<-1theny=y-1:dy=1
800 pc=pc(x,y,gm):gosub1130:print"[154][146]"bk$(pc)
810 gosub1280:ifa$=chr$(13)thengosub50770:goto1060
820 ifa$<>""then890
830 ifx=5then1060
840 if(pc=1)and(pc(x+1,y,gm)<>0)then1060
850 if(pc=2orpc=4)and(pc(x+2,y,gm)<>0orx=4)then1060
860 if(pc=3)and(pc(x+1,y,gm)<>0orpc(x+1,y+1,gm)<>0)then1060
870 if(pc=4)and(pc(x+2,y+1,gm)<>0orx=4)then1060
880 gosub1350:x=x-(x<5):goto1070
890 ifa$<>"[157]"then940
900 ifx=2then1060
910 ifpc(x-1,y,gm)<>0then1060
920 if(pc=3orpc=4)and(pc(x-1,y+1,gm)<>0)then1060
930 gosub1350:x=x+(x>2):goto1070
940 ifa$<>""then1010
950 ify=6then1060
960 if(pc=1orpc=2)and(pc(x,y+1,gm)<>0)then1060
970 if(pc=2)and(pc(x+1,y+1,gm)<>0)then1060
980 if(pc=3orpc=4)and(pc(x,y+2,gm)<>0ory=5)then1060
990 if(pc=4)and(pc(x+1,y+2,gm)<>0)then1060
1000 gosub1350:y=y-(y<6):goto1070
1010 ifa$<>"[145]"then1060
1020 ify=2then1060
1030 ifpc(x,y-1,gm)<>0then1060
1040 if(pc=2orpc=4)and(pc(x+1,y-1,gm)<>0)then1060
1050 gosub1350:y=y+(y>2):goto1070
1060 mv=mv-1
1070 gosub1400
1080 wn=-1:forv=2to6:forh=2to5:ifdn(h,v,gm)=0then1100
1090 ifdn(h,v,gm)<>pc(h,v,gm)thenwn=0:v=7:h=6
1100 next:next:ifnotwnthen650
1110 poke214,20:print:printtab(13)"[158]you got it!!!":gosub50670
1120 print" press any key to continue":gosub1280:run
1130 print"":fora=2tox:print"";:next:fora=2toy:print"";:next:return
1140 print"[147]"tab(14)"[155]instructions":printtab(14)"[163][163][163][163][163][163][163][163][163][163][163][163]"
1150 print"[154] try to position the pieces indicated"
1160 print"at the side into the correct positions,"
1170 print"shown in the small box at the side. note";
1180 print"that in some of the puzzles, not all"
1190 print"pieces have to be in a specific"
1200 print"position."
1210 print" move the pointer using either the"
1220 print"cursor keys or a joystick in port 2."
1230 print"select a piece by pressing and releasing";
1240 print"the fire button or return key."
1250 print" press 'q' at any time to end the game"
1260 print"[158]press any key to continue"
1270 gosub1280:return
1280 poke198,0
1285 geta$:js=peek(56320)and31:ifa$=""andjs=31then1285
1290 if(jsand1)=0thena$="[145]"
1300 if(jsand2)=0thena$=""
1310 if(jsand4)=0thena$="[157]"
1320 if(jsand8)=0thena$=""
1330 if(jsand16)=0thena$=chr$(13):wait56320,16,239
1331 forq=1to100:next
1340 return
1350 pc(x,y,gm)=0
1360 if(pc=2orpc=4)thenpc(x+1,y,gm)=0
1370 if(pc=3orpc=4)thenpc(x,y+1,gm)=0
1380 if(pc=4)thenpc(x+1,y+1,gm)=0
1390 gosub1130:print"[144]"bk$(pc):return
1400 gosub1130:print"[154]"bk$(pc):pc(x,y,gm)=pc
1410 if(pc=2orpc=4)thenpc(x+1,y,gm)=-1
1420 if(pc=3orpc=4)thenpc(x,y+1,gm)=-4
1430 if(pc=4)thenpc(x+1,y+1,gm)=-5
1440 x=x+dx:y=y+dy:mv=mv+1:print"[157][157][157][157][157][157][159]"mv:return
1450 gm=val(a$):print"[147][155]"gm$(gm)
1460 print""tab(25)"[159]solution:"mv(gm):printtab(25)"moves: 0[145][145][145][145]"
1470 print"[158][213][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][201]"
1480 forx=1to15:print"[194] [194]":next
1490 print"[202][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][20